]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Fix visibility of VPN section
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 21 Dec 2017 15:51:28 +0000 (16:51 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 10 Jan 2018 09:11:25 +0000 (10:11 +0100)
Commit f2a9467f91b was too eager to simplify the code, and removed
the bits that hid the section in case no VPNs are set up - add them
back to fix the visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=787845

js/ui/status/network.js

index 9575af7deede62e8f42241f3276a755cb5b98801..ad373f6e646835dbbb21788fe7fe762efb5a36d5 100644 (file)
@@ -1492,6 +1492,15 @@ var NMVPNSection = new Lang.Class({
         this.parent(client);
 
         this.item.menu.addSettingsAction(_("VPN Settings"), 'gnome-network-panel.desktop');
+
+        this._sync();
+    },
+
+    _sync: function() {
+        let nItems = this._connectionItems.size;
+        this.item.actor.visible = (nItems > 0);
+
+        this.parent();
     },
 
     _getDescription: function() {